Instalador Windows 10 PRO

Al montar el instalador de windows en un USB con la herramienta oficial NO da opción a seleccionar qué tipo de versión instalar (Home/PRO/...) Hay que añadir un determinado archivo plano, con cierta extensón -importante que no se guarde como .txt- dentro de /sources
[Channel]
Retail

Convert "string" to boolean

<?php

// via https://stackoverflow.com/a/15075609

This method was posted by @lauthiamkok in the comments. I'm posting it here as an answer to call more attention to it.

Depending on your needs, you should consider using filter_var() with the FILTER_VALIDATE_BOOLEAN flag.

filter_var(      true, FILTER_VALIDATE_BOOLEAN); // true
filter_var(    'true', FILTER_VALIDATE_BOOLEAN); // true
filter_var(         1, FILTER_VALIDATE_BOOLEAN); // true
filter_var(       '1', FILTER_VALIDATE_BOOLEAN); // t

join_that_multiplies_records

https://stackoverflow.com/questions/55147656/why-am-i-having-so-many-records-after-a-join
TableA
Number, Text
----
1, Hello
1, There
1, World


TableB
Number, Text
----
1, Foo
1, Bar
1, Baz

SELECT * FROM TableA a INNER JOIN TableB b ON a.Number = b.Number

a.Number, a.Text, b.Number, b.Text
----------------------------------
1, Hello, 1, Foo
1, Hello, 1, Bar
1, Hello, 1, Baz
1, There, 1, Foo
1, There, 1, Bar
1, There, 1, Baz
1, World, 1, Foo
1, World, 1, Bar
1, World

1920. Build Array from Permutation

Given a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < nums.length and return it. A zero-based permutation nums is an array of distinct integers from 0 to nums.length - 1 (inclusive).
/**
 * @param {number[]} nums
 * @return {number[]}
 */
var buildArray = function(nums) {
    let ans = []; // Initialize an empty array to store the result

    // Iterate through each index in the `nums` array
    for (let i = 0; i < nums.length; i++) {
        ans.push(nums[nums[i]]); // Push the element from `nums` at the index specified by `nums[i]`
    }

    return ans; // Return the resulting array
};

TSQL compare index usage to snapshot

select 
    stats.Table_name,
    stats.Index_name,
    stats.user_seeks,
    i.seeks as snapshot_seeks,
    stats.user_seeks - i.seeks as diff_seeks,
    stats.user_scans,
    i.scans as snapshot_scans,
    stats.user_scans - i.scans as diff_scans,
    stats.user_updates,
    i.updates as snapshot_updates,
    stats.user_updates - i.updates as diff_updates
from (
SELECT
    objects.name AS Table_name,
    indexes.name AS Index_name,
    dm_db_index_usage_stats.user_seeks,
    dm_db_index_usage_

TSQL snapshot index usage stats

insert into index_usage (tableName, indexName, seeks, scans, updates) 
SELECT
    objects.name AS Table_name,
    indexes.name AS Index_name,
    dm_db_index_usage_stats.user_seeks,
    dm_db_index_usage_stats.user_scans,
    dm_db_index_usage_stats.user_updates
FROM
    sys.dm_db_index_usage_stats
        INNER JOIN sys.objects ON dm_db_index_usage_stats.OBJECT_ID = objects.OBJECT_ID
        INNER JOIN sys.indexes ON indexes.index_id = dm_db_index_usage_stats.index_id AND dm_db_index_usage_stat

Share data among browser tabs

/*
  https://javascript.plainenglish.io/3-powerful-ways-to-share-data-across-browser-tabs-in-javascript-a6a98dffa1a3
*/

// 1. local storage
// Sender
localStorage.setItem('sharedData', JSON.stringify({
  message: 'Hello from Tab1!',
  timestamp: Date.now()
}));

// Receiver
window.addEventListener('storage', (e) => {
  if(e.key === 'sharedData') {
    const data = JSON.parse(e.newValue);
    console.log('Received data:', data);
  }
});


// 2.  BroadcastChannel API 
// Create a channel (use the

Reset Styles

/*------------------------------------------------------------------
Custom Font
-------------------------------------------------------------------*/

@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
/* Import font face*/
/* @font-face {
  font-family: 'Adieu';.center
  src: url("{{'Adieu-Bold.eot' | asset_url }}");
  src: url("{{'Adieu-Bold.eot?iefix' | asset_url }}") format('eot'),
       url("{{'Adieu-Bold.woff' | asset_url }}") format('woff'),
       url("

790. Domino and Tromino Tiling

You have two types of tiles: a 2 x 1 domino shape and a tromino shape. You may rotate these shapes. Given an integer n, return the number of ways to tile an 2 x n board. Since the answer may be very large, return it modulo 109 + 7. In a tiling, every square must be covered by a tile. Two tilings are different if and only if there are two 4-directionally adjacent cells on the board such that exactly one of the tilings has both squares occupied by a tile.
/**
 * Calculates the number of ways to tile a 2 × n board using dominos and trominos.
 * @param {number} n - The width of the board.
 * @return {number} - The number of valid tilings, modulo 10^9 + 7.
 */
var numTilings = function (n) {
    const MOD = 1e9 + 7; // Modulo constraint to prevent overflow

    // Base cases for small values of n
    if (n === 1) return 1; // Only one vertical domino fits
    if (n === 2) return 2; // Two configurations: vertical or horizontal dominos

    // Create

wsbill

не открывается https://wsbill.wpstage.by/


sudo resolvectl dns ppp0 172.16.48.3 172.16.48.11
sudo systemctl restart systemd-resolved

Software Development Engineer Roadmap:

# How to become a high quality software engineer?

1128. Number of Equivalent Domino Pairs

Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a == c and b == d), or (a == d and b == c) - that is, one domino can be rotated to be equal to another domino. Return the number of pairs (i, j) for which 0 <= i < j < dominoes.length, and dominoes[i] is equivalent to dominoes[j].
/**
 * Counts the number of equivalent domino pairs.
 * Two dominoes are equivalent if they have the same numbers, regardless of order.
 * 
 * @param {number[][]} dominoes - A list of domino pairs represented as 2-element arrays.
 * @return {number} - The total number of equivalent domino pairs.
 */
var numEquivDominoPairs = function(dominoes) {
    // If there are no dominoes, return 0
    if (!dominoes || dominoes.length === 0) {
        return 0;
    }

    let numPairs = 0; // Counter for eq

learn_how_networkPworks

Ben Eater on youtube: https://www.youtube.com/@BenEater/courses

python_oop

this is a link to a site that teaches API and python oop
https://www.pretzellogix.net/2021/12/08/step-1-read-the-docs-and-use-postman-to-understand-the-rest-api/

Digital Scale

COM Port Sniffer
https://www.nirsoft.net/utils/dll_export_viewer.html

// routes/api.php
Route::get('/weight', function () {
    return response()->json([
        'weight' => trim(file_get_contents(storage_path('app/weight.txt')))
    ]);
});